<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>在线投票系统首页</title>
    <link rel="icon" th:href="@{/source/favicon.ico}" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="在线投票系统">
    <meta name="description" content="在线投票系统">
    <meta name="author" content="柳胜酉">
    <link th:href="@{/source/css/bootstrap.min.css}" href="/css/bootstrap.min.css" rel="stylesheet">
    <link th:href="@{/source/css/materialdesignicons.min.css}" href="/css/materialdesignicons.min.css" rel="stylesheet">
    <link th:href="@{/source/css/style.min.css}" href="/css/style.min.css" rel="stylesheet">
</head>

<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <aside class="lyear-layout-sidebar">

            <!-- logo -->
            <div id="logo" class="sidebar-header">
                <a th:href="@{/index}" href="index.html"><img th:src="@{/source/img/logo-sidebar.png}"
                                                              src="images/logo-sidebar.png"
                                                              title="Kun" alt="Kun"/></a>
            </div>

            <div class="lyear-layout-sidebar-scroll">

                <nav class="sidebar-main">
                    <ul class="nav nav-drawer">
                        <li class="nav-item"><a th:href="@{/main}" href="index.html">
                            在线投票系统</a></li>
                    </ul>
                </nav>

                <div class="sidebar-footer">

                </div>
            </div>

        </aside>
        <!--End 左侧导航-->

        <!--头部信息-->
        <header class="lyear-layout-header">

            <nav class="navbar navbar-default">
                <div class="topbar">

                    <div class="topbar-left">
                        <div class="lyear-aside-toggler">
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                        </div>
                        <span class="navbar-page-title"> 报名信息 </span>
                    </div>
                </div>
                <h1><span sec:authorize="hasRole('0')">[管理员]</span>
                    <span sec:authorize="hasRole('1')">[工作人员]</span>
                    <span sec:authorize="hasRole('2')">[评委]</span>
                    <span sec:authentication="principal.username"></span>
                </h1>
                <a th:href="@{/user/logout}" href="#"> 退出登录</a>
            </nav>

        </header>
        <!--End 头部信息-->

        <!--页面主要内容-->
        <main class="lyear-layout-content">

            <div class="container-fluid">

                <div class="row">
                    <div class="col-lg-12">
                        <div class="card">
                            <div class="card-body">
                                <form method="post" enctype="multipart/form-data"
                                      th:action="@{/user/doUserUpdate(userId=${userDetail.getUserId()})}"
                                      class="form-signin">
                                    <h1 class="h3 mb-3 font-weight-normal">报名信息</h1>
                                    <div>
                                        <label for="photo">头像:</label>
                                        <label>
                                            <img id="photo" name="photo"
                                                 th:src="@{'/source/uploadfiles/'+ ${userDetail.getPhoto()}}" alt="图片审核中"
                                                 src="">
                                        </label>
                                    </div>
                                    <div>
                                        <label for="createTime">报名时间:</label>
                                        <span id="createTime" name="createTime" cols="80"
                                              rows="10"
                                              th:text="${#dates.format(userDetail.getCreateTime,'yyyy-MM-dd')}"></span>

                                    </div>
                                    <div>
                                        <label for="username">重置用户名</label>
                                        <label>
                                            <input th:placeholder="${userDetail.getUsername()}"
                                                   id="username" name="username" cols="80"
                                                   rows="10"></input>
                                        </label>
                                    </div>
                                    <div>
                                        <label for="password">重置密码</label>
                                        <label>
                                            <input placeholder="*******"
                                                   id="password" name="password" cols="80"
                                                   rows="10"></input>
                                        </label>
                                    </div>
                                    <div>
                                        <label for="phone">重置电话</label>
                                        <label>
                                            <input th:placeholder="${userDetail.getPhone()}"
                                                   id="phone" name="phone" cols="80"
                                                   rows="10"></input>
                                        </label>
                                    </div>
                                    <div>
                                        <label for="state">审核状态:</label>
                                        <label>
                                            <span th:text="${userDetail.getStatus()} == '0' ? '免审人员' : (${userDetail.getStatus()} == '1' ? '通过' : (${userDetail.getStatus()} == '2' ? '不通过' : '待审'))"
                                                  id="state" name="state" cols="80"
                                                  rows="10"></span>
                                        </label>
                                    </div>
                                    <div>
                                        <label for="myfile">重置头像</label>
                                        <input type="file" class="form-control" id="myfile" name="myfile"
                                               placeholder="重置头像" required="">
                                    </div>
                                    <span th:hidden="true" th:value="${userDetail.getUserId()}" type="file"
                                          class="form-control" id="userId" name="userId" required=""></span>
                                    <button class="btn btn-lg btn-primary btn-block" type="submit">确认重置</button>
                                    <h5>注意：重新提交报名信息后，系统会再次对您的信息进行审核！</h5>
                                </form>
                            </div>
                        </div>
                    </div>

                </div>

            </div>

        </main>
        <!--End 页面主要内容-->
    </div>
</div>

<script type="text/javascript" th:src="@{/source/js/jquery.min.js}" src="js/jquery.min.js"></script>
<script type="text/javascript" th:src="@{/source/js/bootstrap.min.js}" src="js/bootstrap.min.js"></script>
<script type="text/javascript" th:src="@{/source/js/perfect-scrollbar.min.js}"
        src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" th:src="@{/source/js/main.min.js}" src="js/main.min.js"></script>
<script type="text/javascript">
    $(function () {
        $('.search-bar .dropdown-menu a').click(function () {
            var field = $(this).data('field') || '';
            $('#search-field').val(field);
            $('#search-btn').html($(this).text() + ' <span class="caret"></span>');
        });
    });
</script>
</body>
</html>